package nl.hu.modellingengine.shared;

public class TokenAnalyser {
	
	public static String getValueOfTokenByFieldName(String token,String fieldname){
		String[] fields= token.split("&");
		for(String field: fields){
			boolean correctField = false;
			String[] values = field.split("=");
			for(String value:values){
				if(correctField){
					return value;
				}
				if(value.equals(fieldname)){
					correctField = true;
				}else{
					correctField = false;
				}
			}
		}
		return null;
	}
}
